<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8" />
    <title>收入情况</title>
    <%- include("../include/header.ejs") %>
    <style>
        .ui-jqgrid
        {
            font-size:0.8rem
        }
    </style>
</head>
<body style="width: 100%;overflow-x: hidden">
<div>
    <select id="sid" name="sid">
        <%for(var id in ret.server){%>
        <option value="<%=id%>"><%=ret.server[id]%></option>
        <%}%>
    </select>
    <table id="jqGrid"></table>
    <div id="jqGridPager"></div>
    <span class="oi oi-person"  ></span>
</div>
<%- include('../bpath') %>
<script>
    var branch = '<%=branch%>';
    var handle = 'branch/orderS';
    var grid_selector = '#jqGrid';
    var pager_selector ='#jqGridPager';
    var sid = "<%=ret.sid%>"
    $("#sid").val(sid);
    $("#sid").on("change",reload);
    function reload() {
        cosjs.reload("?sid="+$("#sid").val());
    }

    var option = {
        url : GURL(handle, 'page?sid='+sid),
        colModel : [
            {label: '收入', name: 'sum',key:true,width: 200,editable: false, hidden:false,fixed:true,search:false},
            {label: '开始时间', name: 'bttime',width: 200,editable: true, hidden:false,fixed:true,search:true},
            {label: '截止时间', name: 'time',width: 200,editable: true, hidden:false,fixed:true,search:true},
        ],
    }
    $(document).ready(function () {
        cosjs.jqgrid.create(grid_selector,pager_selector,option,{add:false,edit:false,search:true});
        $("#search_jqGrid").click(changeTimeFormat);
    });



    function changeTimeFormat()
    {
        for(let i=1;i<5;++i)
        {
            let _input=$("#jqg"+i);
            if(_input.attr("name")=="bttime"||_input.attr("name")=="time")
            {
                 cosjs.jqgrid.timeMask(_input);
            }
        }
    }
</script>

</body>
</html>